package com.neusoft.neuiotms.dcam.fixed.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractAuditModel;
import com.neusoft.neuiotms.dcam.common.model.Manufacturer;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 库存管理
 *
 * @author wys
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "neuiot_fixed_stock")
@org.hibernate.annotations.Table(appliesTo = "neuiot_fixed_stock", comment = "库存管理表")
public class Stock extends AbstractAuditModel {

    private static final long serialVersionUID = 1L;

    /** 货品信息 */
    @ManyToOne
    private GoodsFile goodsFile;

    /** 批次信息 */
    @Length(max = 100, message = "批次信息不能超过{max}位")
    @Column(length = 100, nullable = false)
    private String batch;

    /** 供应商 */
    @ManyToOne
    private Manufacturer manufacturer;

    /** 数量 */
    private Integer number;

    /** 单价 */
    private Double unitPrice;

    /** 应用设备 */
    @Column(length = 255, nullable = true)
    private String applyAssetTypeName;

    /** 存放库房 */
    @ManyToOne
    private Storehouse storehouse;

}
